/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef CAMERA_DEVICE_ABILITY_ITEMS_H
#define CAMERA_DEVICE_ABILITY_ITEMS_H

typedef enum camera_ability_section {
    // Camera attribute information: position(facing), type, connection, description, sensor, lens description
    OHOS_CAMERA_PROPERTIES = 0,
    OHOS_CAMERA_LENS,
    OHOS_CAMERA_SENSOR,
    OHOS_CAMERA_SENSOR_INFO,
    OHOS_CAMERA_STATISTICS,

    // Camera device image acquisition
    OHOS_DEVICE_CONTROL  = 0x1000, // Overall control, such as turning off automatic 3A, operating mode
    OHOS_DEVICE_EXPOSURE,
    OHOS_DEVICE_FOCUS,
    OHOS_DEVICE_WHITE_BLANCE,
    OHOS_DEVICE_FLASH,
    OHOS_DEVICE_ZOOM,

    // Camera image post-processing related
    OHOS_POST_PROCESS_CONTROL  = 0x2000,
    OHOS_POST_PROCESS_COLOR,
    OHOS_POST_PROCESS_HDR,
    OHOS_POST_PROCESS_PORTRAIT,
    OHOS_POST_PROCESS_NIGHT,

    // Camera flow control related
    OHOS_STREAM_ABILITY  = 0x3000,
    OHOS_STREAM_CONTROL,   // General control: frame rate, resolution, mirroring
    OHOS_STREAM_JPEG,
    OHOS_STREAM_VIDEO,     // Video encoding related
    OHOS_STREAM_DEPTH,
    OHOS_STREAM_METADATA,
    OHOS_STREAM_METADATA_FACE,
    OHOS_STREAM_METADATA_BODY,

    OHOS_ABILITY_SECTION_END
} camera_ability_section_t;

typedef enum camera_device_metadata_section_start {
    OHOS_CAMERA_PROPERTIES_START = OHOS_CAMERA_PROPERTIES << 16,
    OHOS_CAMERA_LENS_START = OHOS_CAMERA_LENS << 16,
    OHOS_CAMERA_SENSOR_START = OHOS_CAMERA_SENSOR << 16,
    OHOS_CAMERA_SENSOR_INFO_START = OHOS_CAMERA_SENSOR_INFO << 16,
    OHOS_CAMERA_STATISTICS_START = OHOS_CAMERA_STATISTICS <<16,

    OHOS_DEVICE_CONTROL_START = OHOS_DEVICE_CONTROL << 16,
    OHOS_DEVICE_EXPOSURE_START = OHOS_DEVICE_EXPOSURE << 16,
    OHOS_DEVICE_FOCUS_START = OHOS_DEVICE_FOCUS << 16,
    OHOS_DEVICE_WHITE_BLANCE_START = OHOS_DEVICE_WHITE_BLANCE << 16,
    OHOS_DEVICE_FLASH_START = OHOS_DEVICE_FLASH << 16,
    OHOS_DEVICE_ZOOM_START = OHOS_DEVICE_ZOOM << 16,

    OHOS_POST_PROCESS_CONTROL_START = OHOS_POST_PROCESS_CONTROL << 16,
    OHOS_POST_PROCESS_COLOR_START = OHOS_POST_PROCESS_COLOR << 16,
    OHOS_POST_PROCESS_HDR_START = OHOS_POST_PROCESS_HDR << 16,
    OHOS_POST_PROCESS_PORTRAIT_START = OHOS_POST_PROCESS_PORTRAIT << 16,
    OHOS_POST_PROCESS_NIGHT_START = OHOS_POST_PROCESS_NIGHT << 16,

    OHOS_STREAM_ABILITY_START = OHOS_STREAM_ABILITY << 16,
    OHOS_STREAM_CONTROL_START = OHOS_STREAM_CONTROL << 16,
    OHOS_STREAM_JPEG_START = OHOS_STREAM_JPEG << 16,
    OHOS_STREAM_VIDEO_START = OHOS_STREAM_VIDEO << 16,
    OHOS_STREAM_DEPTH_START = OHOS_STREAM_DEPTH << 16,
    OHOS_STREAM_METADATA_START = OHOS_STREAM_METADATA << 16,
    OHOS_STREAM_METADATA_FACE_START = OHOS_STREAM_METADATA_FACE << 16,
    OHOS_STREAM_METADATA_BODY_START = OHOS_STREAM_METADATA_BODY << 16
} camera_device_info_section_start_t;

typedef enum camera_device_metadata_tag {
    // Camera attribute related item
    OHOS_ABILITY_CAMERA_POSITION = OHOS_CAMERA_PROPERTIES_START,
    OHOS_ABILITY_CAMERA_TYPE,
    OHOS_ABILITY_CAMERA_CONNECTION_TYPE,
    OHOS_CAMERA_PROPERTIES_END,

    OHOS_SENSOR_EXPOSURE_TIME = OHOS_CAMERA_SENSOR_START,
    OHOS_SENSOR_COLOR_CORRECTION_GAINS,
    OHOS_CAMERA_SENSOR_END,

    OHOS_SENSOR_INFO_ACTIVE_ARRAY_SIZE = OHOS_CAMERA_SENSOR_INFO_START,
    OHOS_SENSOR_INFO_SENSITIVITY_RANGE,
    OHOS_SENSOR_INFO_MAX_FRAME_DURATION,
    OHOS_SENSOR_INFO_PHYSICAL_SIZE,
    OHOS_SENSOR_INFO_PIXEL_ARRAY_SIZE,
    OHOS_CAMERA_SENSOR_INFO_END,

    OHOS_STATISTICS_FACE_DETECT_MODE = OHOS_CAMERA_STATISTICS_START,
    OHOS_STATISTICS_HISTOGRAM_MODE,
    OHOS_STATISTICS_FACE_IDS,
    OHOS_STATISTICS_FACE_LANDMARKS,
    OHOS_STATISTICS_FACE_RECTANGLES,
    OHOS_STATISTICS_FACE_SCORES,
    OHOS_CAMERA_STATISTICS_END,

    OHOS_CONTROL_AE_ANTIBANDING_MODE = OHOS_DEVICE_CONTROL_START,
    OHOS_CONTROL_AE_EXPOSURE_COMPENSATION,
    OHOS_CONTROL_AE_LOCK,
    OHOS_CONTROL_AE_MODE,
    OHOS_CONTROL_AE_REGIONS,
    OHOS_CONTROL_AE_TARGET_FPS_RANGE,
    OHOS_CONTROL_AF_MODE,
    OHOS_CONTROL_AF_REGIONS,
    OHOS_CONTROL_AWB_LOCK,
    OHOS_CONTROL_AWB_MODE,
    OHOS_CONTROL_AWB_REGIONS,
    OHOS_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
    OHOS_CONTROL_AE_AVAILABLE_MODES,
    OHOS_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
    OHOS_CONTROL_AE_COMPENSATION_RANGE,
    OHOS_CONTROL_AE_COMPENSATION_STEP,
    OHOS_CONTROL_AF_AVAILABLE_MODES,
    OHOS_CONTROL_AWB_AVAILABLE_MODES,
    OHOS_CONTROL_CAPTURE_MIRROR_SUPPORTED,
    OHOS_CONTROL_CAPTURE_MIRROR,
    OHOS_DEVICE_CONTROL_END,

    // Camera device image acquisition related
    OHOS_ABILITY_DEVICE_AVAILABLE_EXPOSUREMODES = OHOS_DEVICE_EXPOSURE_START,
    OHOS_CONTROL_EXPOSUREMODE,
    OHOS_DEVICE_EXPOSURE_END,

    OHOS_ABILITY_DEVICE_AVAILABLE_FOCUSMODES = OHOS_DEVICE_FOCUS_START,
    OHOS_CONTROL_FOCUSMODE,
    OHOS_DEVICE_FOCUS_END,

    OHOS_ABILITY_DEVICE_AVAILABLE_FLASHMODES = OHOS_DEVICE_FLASH_START,
    OHOS_CONTROL_FLASHMODE,
    OHOS_DEVICE_FLASH_END,

    OHOS_ABILITY_ZOOM_RATIO_RANGE = OHOS_DEVICE_ZOOM_START,
    OHOS_CONTROL_ZOOM_RATIO,
    OHOS_DEVICE_ZOOM_END,

    // Camera flow control related
    OHOS_ABILITY_STREAM_AVAILABLE_BASIC_CONFIGURATIONS = OHOS_STREAM_ABILITY_START,
    OHOS_STREAM_AVAILABLE_FORMATS,
    OHOS_STREAM_ABILITY_END,

    OHOS_JPEG_GPS_COORDINATES = OHOS_STREAM_JPEG_START,
    OHOS_JPEG_GPS_PROCESSING_METHOD,
    OHOS_JPEG_GPS_TIMESTAMP,
    OHOS_JPEG_ORIENTATION,
    OHOS_JPEG_QUALITY,
    OHOS_JPEG_THUMBNAIL_QUALITY,
    OHOS_JPEG_THUMBNAIL_SIZE,
    OHOS_JPEG_AVAILABLE_THUMBNAIL_SIZES,
    OHOS_JPEG_MAX_SIZE,
    OHOS_JPEG_SIZE,
    OHOS_STREAM_JPEG_END,
} camera_device_metadata_tag_t;

// OHOS_CAMERA_POSITION
typedef enum camera_position_enum {
    OHOS_CAMERA_POSITION_FRONT = 0,
    OHOS_CAMERA_POSITION_BACK,
    OHOS_CAMERA_POSITION_OTHER
} camera_position_enum_t;

// OHOS_CAMERA_TYPE
typedef enum camera_type_enum {
    OHOS_CAMERA_TYPE_WIDE_ANGLE = 0,
    OHOS_CAMERA_TYPE_ULTRA_WIDE,
    OHOS_CAMERA_TYPE_TELTPHOTO,
    OHOS_CAMERA_TYPE_TRUE_DEAPTH,
    OHOS_CAMERA_TYPE_LOGICAL,
    OHOS_CAMERA_TYPE_UNSPECIFIED,
} camera_type_enum_t;

// OHOS_CAMERA_CONNECTION_TYPE
typedef enum camera_connection_type {
    OHOS_CAMERA_CONNECTION_TYPE_BUILTIN = 0,
    OHOS_CAMERA_CONNECTION_TYPE_USB_PLUGIN,
    OHOS_CAMERA_CONNECTION_TYPE_REMOTE,
} camera_connection_type_t;

// OHOS_EXPOSURE_MODE
typedef enum camera_exposure_mode_enum {
    OHOS_CAMERA_EXPOSURE_MODE_MANUAL = 0,
    OHOS_CAMERA_EXPOSURE_MODE_CONTINUOUS_AUTO
} camera_exposure_mode_enum_t;

// OHOS_FOCUS_MODE
typedef enum camera_focus_mode_enum {
    OHOS_CAMERA_FOCUS_MODE_MANUAL = 0,
    OHOS_CAMERA_FOCUS_MODE_CONTINUOUS_AUTO,
    OHOS_CAMERA_FOCUS_MODE_AUTO,
    OHOS_CAMERA_FOCUS_MODE_LOCKED
} camera_focus_mode_enum_t;

// OHOS_FOCUS_MODE
typedef enum camera_flash_mode_enum {
    OHOS_CAMERA_FLASH_MODE_CLOSE = 0,
    OHOS_CAMERA_FLASH_MODE_OPEN,
    OHOS_CAMERA_FLASH_MODE_AUTO,
    OHOS_CAMERA_FLASH_MODE_ALWAYS_OPEN
} camera_flash_mode_enum_t;

// OHOS_CONTROL_AE_ANTIBANDING_MODE
typedef enum camera_ae_antibanding_mode {
    OHOS_CAMERA_AE_ANTIBANDING_MODE_OFF,
    OHOS_CAMERA_AE_ANTIBANDING_MODE_50HZ,
    OHOS_CAMERA_AE_ANTIBANDING_MODE_60HZ,
    OHOS_CAMERA_AE_ANTIBANDING_MODE_AUTO,
} camera_ae_antibanding_mode_t;

// OHOS_CONTROL_AE_LOCK
typedef enum camera_ae_lock {
    OHOS_CAMERA_AE_LOCK_OFF,
    OHOS_CAMERA_AE_LOCK_ON,
} camera_ae_lock_t;

// OHOS_CONTROL_AE_MODE
typedef enum camera_ae_mode {
    OHOS_CAMERA_AE_MODE_OFF,
    OHOS_CAMERA_AE_MODE_ON,
    OHOS_CAMERA_AE_MODE_ON_AUTO_FLASH,
    OHOS_CAMERA_AE_MODE_ON_ALWAYS_FLASH,
    OHOS_CAMERA_AE_MODE_ON_AUTO_FLASH_REDEYE,
    OHOS_CAMERA_AE_MODE_ON_EXTERNAL_FLASH,
} camera_ae_mode_t;

// OHOS_CONTROL_AF_MODE
typedef enum camera_af_mode {
    OHOS_CAMERA_AF_MODE_OFF,
    OHOS_CAMERA_AF_MODE_AUTO,
    OHOS_CAMERA_AF_MODE_MACRO,
    OHOS_CAMERA_AF_MODE_CONTINUOUS_VIDEO,
    OHOS_CAMERA_AF_MODE_CONTINUOUS_PICTURE,
    OHOS_CAMERA_AF_MODE_EDOF,
} camera_af_mode_t;

// OHOS_CONTROL_AWB_LOCK
typedef enum camera_awb_lock {
    OHOS_CAMERA_AWB_LOCK_OFF,
    OHOS_CAMERA_AWB_LOCK_ON,
} camera_awb_lock_t;

// OHOS_CONTROL_AWB_MODE
typedef enum camera_awb_mode {
    OHOS_CAMERA_AWB_MODE_OFF,
    OHOS_CAMERA_AWB_MODE_AUTO,
    OHOS_CAMERA_AWB_MODE_INCANDESCENT,
    OHOS_CAMERA_AWB_MODE_FLUORESCENT,
    OHOS_CAMERA_AWB_MODE_WARM_FLUORESCENT,
    OHOS_CAMERA_AWB_MODE_DAYLIGHT,
    OHOS_CAMERA_AWB_MODE_CLOUDY_DAYLIGHT,
    OHOS_CAMERA_AWB_MODE_TWILIGHT,
    OHOS_CAMERA_AWB_MODE_SHADE,
} camera_awb_mode_t;

// OHOS_STATISTICS_FACE_DETECT_MODE
typedef enum camera_face_detect_mode {
    OHOS_CAMERA_FACE_DETECT_MODE_OFF,
    OHOS_CAMERA_FACE_DETECT_MODE_SIMPLE,
    OHOS_CAMERA_FACE_DETECT_MODE_FULL,
} camera_face_detect_mode_t;

// OHOS_STATISTICS_HISTOGRAM_MODE
typedef enum camera_histogram_mode {
    OHOS_CAMERA_HISTOGRAM_MODE_OFF,
    OHOS_CAMERA_HISTOGRAM_MODE_ON,
} camera_histogram_mode_t;

// OHOS_STREAM_AVAILABLE_FORMATS
typedef enum camera_format {
    OHOS_CAMERA_FORMAT_RGBA_8888 = 1,
    OHOS_CAMERA_FORMAT_YCBCR_420_888,
    OHOS_CAMERA_FORMAT_YCRCB_420_SP,
    OHOS_CAMERA_FORMAT_JPEG,
} camera_format_t;

#endif
